CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

SET(TARGET_NAME VisualSort)

SET(DIR_WITH_SRC .)
	
INCLUDE_DIRECTORIES(. 
	${PROJECT_SOURCE_DIR}/mUI/
	${PROJECT_SOURCE_DIR}/HGE/include)

SET(DEPENDENCY_LIBS HGE mUI)
LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/dependency/hge/lib/vc)

SET(SRC_FILES "")
FOREACH(DIR IN LISTS DIR_WITH_SRC)
	
	FILE(GLOB FILE_H ${DIR}/*.h)
	FILE(GLOB FILE_CPP ${DIR}/*.cpp ${DIR}/*.c)
	
	STRING(REPLACE "/" "\\\\" SRCGROUP ${DIR})

	IF (${SRCGROUP} STREQUAL .)
		SOURCE_GROUP("${TARGET_NAME}" FILES ${FILE_H} ${FILE_CPP})
	ELSE (${SRCGROUP} STREQUAL .)
		SOURCE_GROUP("${SRCGROUP}" FILES ${FILE_H} ${FILE_CPP})
	ENDIF()	
	
	SET(SRC_FILES ${SRC_FILES} ${FILE_H} ${FILE_CPP})
ENDFOREACH()

IF (WIN32)
	ADD_EXECUTABLE(${TARGET_NAME} WIN32 ${SRC_FILES})
ELSE()
	ADD_EXECUTABLE(${TARGET_NAME} ${SRC_FILES})
ENDIF()

TARGET_LINK_LIBRARIES(${TARGET_NAME} ${DEPENDENCY_LIBS})

FOREACH (LIB IN LISTS IGNORED_LIBS)
	SET_TARGET_PROPERTIES(${TARGET_NAME} 
		PROPERTIES 
		LINK_FLAGS /NODEFAULTLIB:\"${LIB}\")
ENDFOREACH()
